# -*- coding: utf-8 -*-

__author__ = """WebLion <support@weblion.psu.edu>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.ContactsDirectory.config import *

from Products.ContactsDirectory.interfaces.groupinformation import IGroupInformation
from zope.interface import implements

schema = Schema((

    TextField(
        name='groupTopic',
        allowable_content_types=('text/plain', 'text/structured', 'text/html',),
        widget=RichWidget(
            label=u"Group Topic",
            label_msgid='ContactsDirectory_label_groupTopic',
            i18n_domain='ContactsDirectory',
            allow_file_upload=False,
            rows=5,
        ),
        default_output_type='text/x-html-safe'
    ),

    StringField(
        name='title',
        default="Group Topic",
        widget=StringWidget(
            visible={'edit': 'invisible', 'view': 'visible'},
            label=u'Title',
            label_msgid='ContactsDirectory_label_title',
            i18n_domain='ContactsDirectory',
        ),
        accessor="Title"
    ),

),
)

GroupInformation_schema = BaseSchema.copy() + schema.copy()

class GroupInformation(BaseContent):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(BaseContent,'__implements__',()),)
    implements(IGroupInformation)
    meta_type = portal_type = 'CDGroupInformation'
    schema = GroupInformation_schema
registerType(GroupInformation, PROJECTNAME)
